const service = require('../service/regist')
module.exports = async (ctx, next) => {
  await ctx.verifyParams({
    username: { type: 'string', min: 1 },
    password: { type: 'string', min: 1 },
    initialLevel: { type: 'int', min: 1, max: 3 },
    learnPurpose: { type: 'int', min: 1, max: 5 },
    planning: { type: 'int', min: 1, max: 4 },
    learnStyle: { type: 'int', min: 1 }
  })
  await service(ctx)
  await next()
}
